<template>
    <div class="list">
        <van-cell-group>
            <van-cell v-for="item in list" v-bind:key="item.accountId" :title="item.typeName" is-link @click.native="goDetail(item.accountId)" :value="item.accountBalance | money"></van-cell>
        </van-cell-group>
    </div>
</template>

<script>
export default {
    name: 'capitalList',
    data() {
        return {
            list: []
        }
    },

    methods: {
        getUserAccountList() {
            this.$http.post('/user/userAccount/front/getUserAccountList', {}).then(res => {
                if (res.status === 0) {
                    this.list = res.data;
                    console.log(this.list)
                } else {
                    this.$toast.fail(res.message);
                }
            })
        },

        goDetail(accountId) {
            console.log(accountId)
            this.$router.push('detail?id=' + accountId)
        }
    },

    created() {
        this.getUserAccountList();
    }
}
</script>

<style scoped lang="scss">
/deep/ .van-cell__value {
    color: #f00;
}
</style>
